﻿#region Namespace References

using System;

#endregion

namespace DynConDevCorp.OpenArch.SmartData.Interfaces.Attributes
{
    /// <summary>
    /// Attribute used to Dynamically associate a .NET Property with a SmartField instance.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public sealed class AutoFieldAttribute : Attribute
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="AutoFieldAttribute"/> class.
        /// </summary>
        public AutoFieldAttribute()
        {
            AutoCreate = true;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AutoFieldAttribute"/> class.
        /// </summary>
        /// <param name="fieldName">Name of the field.</param>
        public AutoFieldAttribute(string fieldName)
        {
            FieldName = fieldName;
        }

        #endregion

        #region Public Instance Properties

        /// <summary>
        /// Gets or sets a value indicating whether [auto create].
        /// </summary>
        /// <value><c>true</c> if [auto create]; otherwise, <c>false</c>.</value>
        public Boolean AutoCreate { get; set; }

        /// <summary>
        /// Gets or sets the display format.
        /// </summary>
        /// <value>The display format.</value>
        public string DisplayFormatString { get; set; }

        /// <summary>
        /// Gets or sets the name of the field.
        /// </summary>
        /// <value>The name of the field.</value>
        public String FieldName { get; private set; }

        /// <summary>
        /// Gets or sets a value indicating whether [input inhibited].
        /// </summary>
        /// <value><c>true</c> if [input inhibited]; otherwise, <c>false</c>.</value>
        public Boolean InputInhibited { get; set; }

        /// <summary>
        /// Gets or sets the value changed.
        /// </summary>
        /// <value>The value changed.</value>
        public String ValueChanged { get; set; }

        #endregion
    }
}